package io.renren.modules.module.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @author miaotongli
 * 模块
 */
@TableName(value = "bm_module")
@Data
public class Module implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "模块id")
    private Long moduleId;

    @NotBlank(message = "模块名字不可为空")
    @ApiModelProperty(value = "模块名称")
    private String moduleName;

    @NotBlank(message = "模块描述不可为空")
    @ApiModelProperty(value = "模块描述")
    private String moduleDesc;

    @ApiModelProperty("产品id")
    @NotNull(message = "产品id不可为空")
    private Long productId;

    @ApiModelProperty("模块所属开发者")
    @NotNull(message = "模块所属开发者不可为空")
    private Long moduleUser;
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "数据创建者")
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    @ApiModelProperty(value = "数据最后修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date lastEditTime;

    @ApiModelProperty(value = "数据最后修改者")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long lastEditUser;

    @ApiModelProperty(value = "逻辑删除（1：未删除 2：已删除）")
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer delStatus;

    @Override
    public String toString() {
        return "Module{" +
                "moduleId=" + moduleId +
                ", moduleName='" + moduleName + '\'' +
                ", moduleDesc='" + moduleDesc + '\'' +
                ", productId=" + productId +
                ", moduleUser=" + moduleUser +
                ", createUser=" + createUser +
                ", lastEditUser=" + lastEditUser +
                ", createTime=" + createTime +
                ", lastEditTime=" + lastEditTime +
                ", delStatus=" + delStatus +
                '}';
    }
}
